﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PaymentPrint.aspx.cs" Inherits="TVMCORP.TVS.Layouts.TVMCORP.TVS.PaymentPrint"
    DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <link href="../images/TVMCORP.TVS/css/style.css" rel="stylesheet" type="text/css" />
    <script src="../1033/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/_layouts/1033/request-script.js?Ver=<%=DateTime.Now.Ticks %>" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var total = 0;
            var currency = "VNĐ";

            if ($('#<%=rdbUSD.ClientID%>').is(":checked")) {
                currency = "USD";
            }

            $(".total_currency").each(function (e) {
                $(this).text(currency);
            });

            $(".table_request_detail tr.row2").each(function (e) {
                var amount = $(this).find('span.request_detail_amount').text();
                if (amount != undefined && amount != '') {
                    total += removeComma(amount) * 1;
                }
            });

            $("#total_price").text(formatNumber(total, ",", 3, 0));

            $("#total_price_text").text(DocTienBangChu(total));
        });

        var win = null;
        function printIt(printThis) {
            win = window.open();
            self.focus();
            win.document.open();
            win.document.write('<' + 'html' + '><' + 'head' + '><' + 'style' + '>');
            win.document.write('.container_form { width: 960px; margin: 0 auto; align: center; margin: 0px 10px 10px 10px; font-size: 12px !important;}');
            win.document.write('.title_company { margin: 0px 0px 0px 5px; padding: 10px 0px 10px 0px; font: bold 14px Arial, Helvetica, sans-serif; color: #003366; text-transform: uppercase; }');
            win.document.write('.title_company span { font-style: italic; font: bold 12px Arial, Helvetica, sans-serif; color: #757575; }');
            win.document.write('.title_request { margin: 0px 0px 0px 5px; padding: 10px 0px 10px 0px; font: bold 24px Arial, Helvetica, sans-serif; color: #003366; text-transform: uppercase; }');
            win.document.write('.title_request span { font: bold 12px Arial, Helvetica, sans-serif; color: #757575; }');
            win.document.write('.title_unit { color: #000000; font: normal 12px Arial,Helvetica, sans-serif; text-align: left; padding: 5px 5px 5px 5px; }');
            win.document.write('.title_unit span { font: bold 14px Arial, Helvetica, sans-serif; color: #ff0000; padding: 0px 0px 0px 5px; }');
            win.document.write('.date_request { color: #000000; font: normal 12px Arial,Helvetica, sans-serif; padding: 5px 5px 5px 5px; }');
            win.document.write('.date_request span { font: normal 12px Arial, Helvetica, sans-serif; color: #ff0000; padding: 0px 0px 0px 5px; }');
            win.document.write('table.tablelist { width: 100%; border: 1px solid #e2edf9; border-collapse: collapse;}');
            win.document.write('table.tablelist tr td {padding: 5px; font: normal 11px Arial,Helvetica, sans-serif; color: #4d4d4d; border: 1px solid #45aefe !important; }');
            win.document.write('table.tablelist tr.row_title td { background: #038cd3; color: #ffffff; font: bold 12px Arial,Helvetica, sans-serif; text-decoration: none; padding: 5px 5px 5px 5px; }');
            win.document.write('table.tablelist tr.row1 td { background: #cce6f5; color: #000000; font: bold 12px Arial,Helvetica, sans-serif; text-transform: uppercase; padding: 5px 5px 5px 5px; }');
            win.document.write('table.tablelist tr.row2 td { background: #ffffff; color: #303030; font: normal 12px Arial,Helvetica, sans-serif; }');
            win.document.write('table.tablelist tr.row2 td.request_text_lable { background-color: #ffffff; color: #000000; font: normal 12px Arial,Helvetica, sans-serif; padding: 5px 5px 5px 5px; }');
            win.document.write('table.tablelist tr.row2 td.sum { background-color: #ffffff; color: #000000; font: bold 16px Arial,Helvetica, sans-serif; padding: 5px 5px 5px 5px; }');
            win.document.write('table.tablelist tr.row2 td.sum span { background-color: #ffffff; color: #ff0000; font: bold 16px Arial, Helvetica, sans-serif; padding: 5px 5px 5px 5px; }');
            win.document.write('.request_column1 { padding: 3px 15px 3px 0px;}');
            win.document.write('.request_column2{ padding: 3px 0px 3px 15px; }');
            win.document.write('<' + '/' + 'style' + '><' + '/' + 'head' + '><' + 'body' + '>');
            win.document.write('<' + 'center' + '>');
            win.document.write(printThis);
            win.document.write('<' + '/' + 'center' + '>');
            win.document.write('<' + '/' + 'body' + '><' + '/' + 'html' + '>');
            win.document.close();
            win.print();
            win.close();
        }

        if (typeof (_spBodyOnLoadFunctionNames) != 'undefined' && _spBodyOnLoadFunctionNames != null) {
            _spBodyOnLoadFunctionNames.push("supressSubmitWraper");
        }

        function supressSubmitWraper() {
            _spSuppressFormOnSubmitWrapper = true;
        }
   
    </script>
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <div id="print_content" class="container_form">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td width="40%" align="right">
                    <img src="../../_layouts/images/TVMCORP.TVS/logo_form.png" alt="logo" align="absmiddle" />
                </td>
                <td width="60%" class="title_company" align="center">
                    <asp:Literal ID="literalCompany" Text="CÔNG TY CỔ PHẦN TRUYỀN THÔNG TRÍ VIỆT" runat="server"></asp:Literal>
                    <br />
                    <span>
                        <asp:Literal ID="literalCompanyEnglish" Text="TRI VIET MEDIA CORP.(TVM)" runat="server"></asp:Literal>
                    </span>
                </td>
            </tr>
            <tr>
                <td colspan="2" class="title_request" align="center">
                    <asp:Literal ID="literalRequestTitle" Text="ĐỀ NGHỊ THANH TOÁN" runat="server"></asp:Literal>
                </td>
            </tr>
        </table>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td class="request_column1" width="50%" align="right">
                    <SharePoint:FieldLabel FieldName="Title" ID="flbTitle" ControlMode="Display" runat="server">
                    </SharePoint:FieldLabel>
                    :
                </td>
                <td class="request_column2" width="50%" align="left">
                    <SharePoint:FormField FieldName="Title" ID="ffTitle" ControlMode="Display" runat="server">
                    </SharePoint:FormField>
                </td>
            </tr>
            <tr>
                <td class="request_column1" width="50%" align="right">
                    <SharePoint:FieldLabel FieldName="DateRequest" ID="flbDateRequest" ControlMode="Display"
                        runat="server">
                    </SharePoint:FieldLabel>
                    :
                </td>
                <td class="request_column2" width="50%" align="left">
                    <asp:Literal ID="literalDateRequestValue" Text="" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="request_column1" width="50%" align="right">
                    <SharePoint:FieldLabel FieldName="UserRequest" ID="flbUserRequest" ControlMode="Display"
                        runat="server">
                    </SharePoint:FieldLabel>
                    :
                </td>
                <td class="request_column2" width="50%" align="left">
                    <SharePoint:FormField FieldName="UserRequest" ID="ffUserRequest" ControlMode="Display"
                        runat="server">
                    </SharePoint:FormField>
                </td>
            </tr>
            <tr>
                <td class="request_column1" width="50%" align="right">
                    <SharePoint:FieldLabel FieldName="DepartmentRequest" ID="flbDepartmentRequest" ControlMode="Display"
                        runat="server">
                    </SharePoint:FieldLabel>
                    :
                </td>
                <td class="request_column2" width="50%" align="left">
                    <SharePoint:FormField FieldName="DepartmentRequest" ID="ffDepartmentRequest" ControlMode="Display"
                        runat="server">
                    </SharePoint:FormField>
                </td>
            </tr>
            <tr>
                <td class="request_column1" width="50%" align="right">
                    <SharePoint:FieldLabel FieldName="TypeOfPayment" ID="flbTypeOfPayment" ControlMode="Display"
                        runat="server">
                    </SharePoint:FieldLabel>
                    :
                </td>
                <td class="request_column2" width="50%" align="left">
                    <SharePoint:FormField FieldName="TypeOfPayment" ID="ffTypeOfPayment" ControlMode="Display" runat="server">
                    </SharePoint:FormField>
                </td>
            </tr>
            <tr>
                <td class="request_column1" width="50%" align="right">
                    <SharePoint:FieldLabel FieldName="Status" ID="flbStatus" ControlMode="Display" runat="server">
                    </SharePoint:FieldLabel>
                    :
                </td>
                <td class="request_column2" width="50%" align="left">
                    <SharePoint:FormField FieldName="Status" ID="ffStatus" ControlMode="Display" runat="server">
                    </SharePoint:FormField>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    &nbsp;&nbsp;
                    <br />
                    &nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table width="100%" cellspacing="0" cellpadding="0" class="tablelist table_request_detail"
                        border="2" style="border-collapse: collapse">
                        <tr>
                            <td style="border: 1px solid #45aefe; padding: 5px 0px 5px 0px; text-transform: uppercase;
                                font: bold 16px Arial, Helvetica, sans-serif;" colspan="3">
                                Nội dung thanh toán
                            </td>
                        </tr>
                        <tr class="row2">
                            <td style="border: 1px solid #45aefe; padding: 5px 5px 5px 5px;" class="payment_currency"
                                align="center" valign="middle" colspan="3">
                                <asp:RadioButton ID="rdbVND" Text="VND" GroupName="Currency" Checked="true" runat="server" />
                                &nbsp;&nbsp;
                                <asp:RadioButton ID="rdbUSD" Text="USD" GroupName="Currency" runat="server" />
                            </td>
                        </tr>
                        <tr class="row_title">
                                    <td style="border: 1px solid #45aefe;" width="5%" align="center" valign="middle">
                                        STT
                                    </td>
                                    <td style="border: 1px solid #45aefe;" width="50%" align="center" valign="middle">
                                        Nội dung
                                    </td>
                                    <td style="border: 1px solid #45aefe;" width="35%" align="center" valign="middle">
                                        Số tiền
                                    </td>
                                </tr>
                        <asp:Repeater ID="repeaterRequestDetail" runat="server">
                            <HeaderTemplate>
                                
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr class="row2">
                                    <td style="border: 1px solid #45aefe;" align="center" valign="middle" class="request_text_lable">
                                        <asp:Literal ID="literalOrder" runat="server"></asp:Literal>
                                    </td>
                                    <td style="border: 1px solid #45aefe;" align="left" valign="middle" class="request_text_lable">
                                        <asp:Literal ID="literalContent" runat="server"></asp:Literal>
                                    </td>
                                    <td style="border: 1px solid #45aefe;" align="center" valign="middle" class="request_text_lable">
                                        <asp:Label ID="lableAmount" CssClass="request_detail_amount" runat="server" Text=""></asp:Label>
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                <tr>
                                    <td style="border: 1px solid #45aefe;" align="right" valign="middle" colspan="3">
                                        <b>Tổng cộng : &nbsp;&nbsp; <span id="total_price"></span>&nbsp; <span class="total_currency">
                                        </span>
                                            <br />
                                            <i>(<span id="total_price_text"></span> <span class="total_currency"></span>)</i>
                                        </b>
                                    </td>
                                </tr>
                            </FooterTemplate>
                        </asp:Repeater>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    &nbsp;&nbsp;
                    <br />
                    &nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table width="100%" cellspacing="0" cellpadding="0" class="tablelist" border="2"
                        style="border-collapse: collapse">
                        <tr>
                            <td style="border: 1px solid #45aefe; padding: 5px 0px 5px 0px; text-transform: uppercase;
                                font: bold 16px Arial, Helvetica, sans-serif;" colspan="5">
                                <asp:Literal ID="literalReferenceTitle" Text="Đề nghị tham chiếu" runat="server"></asp:Literal>
                            </td>
                        </tr>
                        <tr class="row_title">
                                    <td style="border: 1px solid #45aefe;" width="5%" align="center" valign="middle">
                                        STT
                                    </td>
                                    <td style="border: 1px solid #45aefe;" width="45%" align="center" valign="middle">
                                        Tiêu đề
                                    </td>
                                    <td style="border: 1px solid #45aefe;" width="15%" align="center" valign="middle">
                                        Ngày
                                    </td>
                                    <td style="border: 1px solid #45aefe;" width="20%" align="center" valign="middle">
                                        Người đề nghị
                                    </td>
                                    <td style="border: 1px solid #45aefe;" width="15%" align="center" valign="middle">
                                        Bộ phận
                                    </td>
                                </tr>
                        <asp:Repeater ID="repeaterRequestReference" runat="server">
                            <HeaderTemplate>
                                
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr class="row2">
                                    <td style="border: 1px solid #45aefe;" align="center" valign="middle" class="request_text_lable">
                                        <asp:Literal ID="literalOrder" runat="server"></asp:Literal>
                                    </td>
                                    <td style="border: 1px solid #45aefe;" align="left" valign="middle" class="request_text_lable">
                                        <asp:LinkButton ID="linkButtonReferenceTitle" runat="server"></asp:LinkButton>
                                    </td>
                                    <td style="border: 1px solid #45aefe;" align="center" valign="middle" class="request_text_lable">
                                        <asp:Literal ID="literalReferenceDate" runat="server"></asp:Literal>
                                    </td>
                                    <td style="border: 1px solid #45aefe;" align="left" valign="middle" class="request_text_lable">
                                        <asp:Literal ID="literalReferenceUser" runat="server"></asp:Literal>
                                    </td>
                                    <td style="border: 1px solid #45aefe;" align="left" valign="middle" class="request_text_lable">
                                        <asp:Literal ID="literalReferenceDepartment" runat="server"></asp:Literal>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    &nbsp;&nbsp;
                    <br />
                    &nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table width="100%" cellspacing="0" cellpadding="0" class="tablelist" border="2"
                        style="border-collapse: collapse">
                        <tr>
                            <td style="border: 1px solid #45aefe; padding: 5px 0px 5px 0px; text-transform: uppercase;
                                font: bold 16px Arial, Helvetica, sans-serif;" colspan="5">
                                Thông tin duyệt
                            </td>
                        </tr>
                        <tr class="row_title">
                            <td style="border: 1px solid #45aefe;" width="20%" align="center" valign="middle">
                                Trưởng bộ phận
                            </td>
                            <td style="border: 1px solid #45aefe;" width="20%" align="center" valign="middle">
                                Kế toán kiểm tra
                            </td>
                            <td style="border: 1px solid #45aefe;" width="20%" align="center" valign="middle">
                                Kế toán trưởng
                            </td>
                            <td style="border: 1px solid #45aefe;" width="20%" align="center" valign="middle">
                                Người phê duyệt
                            </td>
                        </tr>
                        <tr class="row2">
                            <td style="border: 1px solid #45aefe;" align="center" valign="middle" class="request_text_lable">
                                <SharePoint:FormField FieldName="Chief" ID="ffChief" ControlMode="Display" runat="server">
                                </SharePoint:FormField>
                            </td>
                            <td style="border: 1px solid #45aefe;" align="center" valign="middle" class="request_text_lable">
                                <SharePoint:FormField FieldName="Accountant" ID="ffAccountant" ControlMode="Display" runat="server">
                                </SharePoint:FormField>
                            </td>
                            <td style="border: 1px solid #45aefe;" align="center" valign="middle" class="request_text_lable">
                                <SharePoint:FormField FieldName="HeadAccountant" ID="ffHeadAccountant" ControlMode="Display" runat="server">
                                </SharePoint:FormField>
                            </td>
                            <td style="border: 1px solid #45aefe;" align="center" valign="middle" class="request_text_lable">
                                <SharePoint:FormField FieldName="Approver" ID="ffApprover" ControlMode="Display" runat="server">
                                </SharePoint:FormField>
                            </td>
                        </tr>
                        <tr class="row2">
                            <td style="border: 1px solid #45aefe;" align="center" valign="middle" class="request_text_lable">
                                <SharePoint:FormField FieldName="ChiefDate" ID="FormField9" ControlMode="Display"
                                    runat="server">
                                </SharePoint:FormField>
                                <b>&nbsp;
                                <SharePoint:FormField FieldName="ChiefStatus" ID="FormField1" ControlMode="Display"
                                    runat="server">
                                </SharePoint:FormField></b>
                            </td>
                            <td style="border: 1px solid #45aefe;" align="center" valign="middle" class="request_text_lable">
                                <SharePoint:FormField FieldName="AccountantDate" ID="FormField10" ControlMode="Display"
                                    runat="server">
                                </SharePoint:FormField>
                                <b>&nbsp;
                                <SharePoint:FormField FieldName="AccountantStatus" ID="FormField2" ControlMode="Display"
                                    runat="server">
                                </SharePoint:FormField></b>
                            </td>
                            <td style="border: 1px solid #45aefe;" align="center" valign="middle" class="request_text_lable">
                                <SharePoint:FormField FieldName="HeadAccountantDate" ID="ffHeadAccountantDate" ControlMode="Display"
                                    runat="server">
                                </SharePoint:FormField>
                                <b>&nbsp;
                                <SharePoint:FormField FieldName="HeadAccountantStatus" ID="FormField3" ControlMode="Display"
                                    runat="server">
                                </SharePoint:FormField></b>
                            </td>
                            <td style="border: 1px solid #45aefe;" align="center" valign="middle" class="request_text_lable">
                                <SharePoint:FormField FieldName="ApproverDate" ID="FormField12" ControlMode="Display"
                                    runat="server">
                                </SharePoint:FormField>
                                <b>&nbsp;
                                <SharePoint:FormField FieldName="ApproverStatus" ID="FormField4" ControlMode="Display"
                                    runat="server">
                                </SharePoint:FormField></b>
                            </td>
                        </tr>
                        <tr class="row2">
                            <td style="border: 1px solid #45aefe;" align="left" valign="middle" class="request_text_lable">
                                <SharePoint:FormField FieldName="ChiefComment" ControlMode="Display" ID="FormField5"
                                    runat="server">
                                </SharePoint:FormField>
                            </td>
                            <td style="border: 1px solid #45aefe;" align="left" valign="middle" class="request_text_lable">
                                <SharePoint:FormField FieldName="AccountantComment" ControlMode="Display" ID="FormField6"
                                    runat="server">
                                </SharePoint:FormField>
                            </td>
                            <td style="border: 1px solid #45aefe;" align="left" valign="middle" class="request_text_lable">
                                <SharePoint:FormField FieldName="HeadAccountantComment" ControlMode="Display" ID="FormField7"
                                    runat="server">
                                </SharePoint:FormField>
                            </td>
                            <td style="border: 1px solid #45aefe;" align="left" valign="middle" class="request_text_lable">
                                <SharePoint:FormField FieldName="ApproverComment" ControlMode="Display" ID="FormField8"
                                    runat="server">
                                </SharePoint:FormField>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    &nbsp;&nbsp;
                    <br />
                    &nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td style="padding: 5px 5px 5px 5px;" colspan="2">
                    <asp:HyperLink ID="hyperLinkViewDiscussion" Target="_blank" runat="server"><i>Xem thảo luận</i></asp:HyperLink>
                </td>
            </tr>
        </table>
    </div>
    <table cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td class="ms-formline">
                <img src="/_layouts/images/blank.gif" width='1' height='1' alt="" />
            </td>
        </tr>
    </table>
    <table cellpadding="0" cellspacing="0" width="100%" style="padding-top: 7px">
        <tr>
            <td width="100%" align="right">
                <asp:Button runat="server" ID="btnPrint" CssClass="ms-ButtonHeightWidth" Text="Print"
                    Enabled="true" OnClientClick="printIt(document.getElementById('print_content').innerHTML); return false" />
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    Payment Print
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
    runat="server">
    Payment Print
</asp:Content>
